<%@ page language="java" contentType="text/html; utf-8"
    pageEncoding="utf-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
  <title>layout 后台大布局 - Layui</title>
  <link rel="stylesheet" href="${pageContext.request.contextPath}/static/layui/css/layui.css">
</head>
<body class="layui-layout-body">
<div class="layui-layout layui-layout-admin">
  <div class="layui-header">
    <div class="layui-logo">layui 后台布局</div>
    <!-- 头部区域（可配合layui已有的水平导航） -->
    <ul class="layui-nav layui-layout-left">
      <li class="layui-nav-item"><a href="${pageContext.request.contextPath}/user.do?method=findUserByPage&pageNum=1" target="main">控制台</a></li>
      <li class="layui-nav-item"><a href="">商品管理</a></li>
      <li class="layui-nav-item"><a href="">用户</a></li>
      <li class="layui-nav-item">
        <a href="javascript:;">其它系统</a>
        <dl class="layui-nav-child">
          <dd><a href="">邮件管理</a></dd>
          <dd><a href="">消息管理</a></dd>
          <dd><a href="">授权管理</a></dd>
        </dl>
      </li>
    </ul>
    
    <ul class="layui-nav layui-layout-right">
      <li class="layui-nav-item">
        <a href="javascript:;">
          <img src="http://t.cn/RCzsdCq" class="layui-nav-img">
          贤心
        </a>
        <dl class="layui-nav-child">
          <dd><a href="">基本资料</a></dd>
          <dd><a href="">安全设置</a></dd>
        </dl>
      </li>
      <li class="layui-nav-item"><a href="">退了</a></li>
    </ul>
  </div>
  
  <div class="layui-side layui-bg-black" id="wrapper">
    <div class="layui-side-scroll" >
      <!-- 左侧导航区域（可配合layui已有的垂直导航） 
      
      -->
      <template v-for="(item, index) in menuData">
      <ul class="layui-nav layui-nav-tree"  lay-filter="test" >
        <li class="layui-nav-item" >
          <a class="" href="javascript:;">{{ item.menu.menuName }}</a>
          <dl class="layui-nav-child" v-for="(itm, idx) in item.items">
            <dd><a :href="'${pageContext.request.contextPath}' + itm.menuUrl + '&tgName=' + itm.menuName + '&tgId=' + itm.menuId +'&pageNum=' +1" :data-href="'${pageContext.request.contextPath}' + itm.menuUrl" target="main">{{itm.menuName}}</a></dd>

          </dl>
          
        </li>
         
        
      </ul>
       </template>
    </div>
  </div>
  
  <div class="layui-body">
    <!-- 内容主体区域 -->
    <iframe name="main" src="https://www.baidu.com/" frameborder="0" height="100%" width="100%"></iframe>
   <!--  <div style="padding: 15px;">
		
           
       <table id="user" lay-filter="test"></table>
                    
                
	</div> -->
  </div>
  
  <div class="layui-footer">
    <!-- 底部固定区域 -->
    © layui.com - 底部固定区域
  </div>
</div>
<script src="${pageContext.request.contextPath}/static/js/vue.min.js"></script>
<script src="${pageContext.request.contextPath}/static/layui/layui.js"></script>
 <script type="text/javascript">
   		var _vm = new Vue({
   			el : "#wrapper",
   			data : {
   				iframeUrl : "",
   				menuShow : null,
   				menuText : "${permissionTip}",
   				menuData : [],
   				menuTemp : ${menuTree}
   			},
   			methods : {
   				openToFrame : function(event){
   					var url = event.srcElement.getAttribute("data-href");
   					console.log(url);
   					this.iframeUrl = url;
   				},
   				v_init : function(){
   					if(this.menuTemp != null && this.menuTemp.length>0){
   						this.menuData = this.menuTemp;
   					}
   				},
   				show : function(){
   					console.log(this.menuTemp);
   				}
   			}
   		});
   		_vm.v_init();
    </script>
<script>

//JavaScript代码区域
layui.use('element', function(){
  var element = layui.element;
  
});
layui.use('table', function(){
    var table = layui.table;
    
    //第一个实例
    table.render({
       elem: '#user'
      ,height: 315
      ,url: '/user.do?method=findUserByPage&pageNum=1' //数据接口
      ,page: true //开启分页
      ,cols: [[ //表头
        {field: 'userid', title: '账号', width:80, sort: true, fixed: 'left'}
        ,{field: 'username', title: '用户名', width:80}
        ,{field: '密码', title: '性别', width:80, sort: true}
       
       
      ]]
    });
    
  });
</script>
</body>
</html>